package com.baidu.dao;

import com.baidu.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;

public interface OrdersettingDao {

    @Select("select number, reservations from t_ordersetting where orderDate=#{orderDate,jdbcType=DATE}")
    OrderSetting findByOrderDate(Date date);

    @Update("update t_ordersetting set number = #{number} where orderDate=#{orderDate, jdbcType=DATE}")
    void update(OrderSetting orderSetting);

    @Insert("insert into t_ordersetting(orderDate,number,reservations) " +
            "values(#{orderDate, jdbcType=DATE}, #{number}, #{reservations})")
    void add(OrderSetting orderSettingList);
}
